#####轮播图表格
class Carousel
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Attributes::Dynamic

  field :area, type: String
  field :start_time, type: DateTime
  field :end_time, type: DateTime
  field :url, type: String

  field :field_mark, type: Integer, default: 0 #栏位标示（1..6）
  field :event_mark, type: Integer, default: 0 #事件标示（0:不做跳转，1:商品详细，2:促销活动H5，3:商品列表,4:组合购跳转）
  field :event_memo, type: String #事件备注
  field :avatar_url, type: String, default: 0 #图片路径

  attr_readonly *fields.keys

  def full_avatar_url

    RestConfig::ELEPHANT_HOST+self.avatar_url
  end

end
